package cn.harry.modular.portrait.vo;

import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class UserSegmentsCondition {

    /**
     * 人群名称
     */
    @Schema(description = "人群名称")
    private String segmentName;
    /**
     * 推送: 消息通知、电子邮件、短信
     */
    @Schema(description = "推送: 消息通知、电子邮件、短信")
    private String pushStatus;

    @Schema(description = "条件")
    private List<Condition> conditions;

    @Data
    public static class Condition {
        @Schema(description = "字段")
        private String field;
        @Schema(description = "值")
        private String value;
        @Schema(description = "操作符 = < >")
        private String operator;
        @Schema(description = "逻辑操作符 and or")
        private String logicOperator;
    }
    /**
     * 查询参数
     */
    @Schema(description = "查询参数")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private JSONArray selectConditions;

//    人口属性： 用户性别(shoppingGender)、活跃度(userActivityLevel)
//    行为属性：近 30 日购买次数(recent30DaysPurchaseCount)、近 30日购买金额(recent30DaysPurchaseAmount)
//    风险控制：近 30日支付异常次数、用户信用评分、近30日异地登录次数、密码强度、近x日是否申请贷款
}
